package com.weipai.springboot.module.mapper;

import com.weipai.springboot.model.Brand;
import com.weipai.springboot.model.Shop;
import com.weipai.springboot.model.ShopCategory;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;

import java.util.List;
import java.util.Map;

/**
 * 店铺类别
 */
public interface ShopCategoryMapper extends Mapper<ShopCategory>,MySqlMapper<ShopCategory> {

    //获取数据（不包含逻辑删除的数据）
    List<Shop> selectAllByShopCategoryDel(@Param("del") int brandDel, @Param("search") String search,
                                          @Param("sort") String sort, @Param("way") String way);

    //查询店铺类别详情
    ShopCategory getShopCategoryById(String shopCategoryId);

    //更改商品类别的状态
    @Update("update c_shop_category set shop_category_status=#{status}, update_time=date_format(now(), '%Y-%m-%d %H:%i:%s') " +
            "where shop_category_id=#{id}")
    int updateStatus(@Param("id")String shopCategoryId, @Param("status")Integer status);

    //批量删除
    int batchDeleteById(String[] id);

    //获取店铺分类
    List<Map<String,Object>> getShopCategory();
}